<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>男装专区</title>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/loading.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/base.css"/>
    <link rel="stylesheet" type="text/css" href="<%=path %>/statics/css/style.css"/>
      <script src="<%=path %>/statics/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    	$(window).load(function(){
    		$(".loading").addClass("loader-chanage");
    		$(".loading").fadeOut(300);
    	});
    </script>
    <script type="text/javascript">
    	var num;
    	//删除进行时
		function deleteorder(){
		 	 $.ajax({
				type:"GET",
				url:"<%=path%>/OrderDetail/delOrder.json",
				data:{id:num},
				dataType:"json",
				success:function(data){
				
					if(data.delOrder=="true"){//删除成功：移除当前div,无提示，异步刷新
					var order = document.getElementById(num); 
					order.remove();
						/* obj.parent().parent().parent().remove(); */
					}else if(data.delOrder == "false"){//删除失败
						alert("对不起，删除失败");
					}else{
						alert(111);
					}
				},
				error:function(data){  //异常
					alert("对不起，删除异常");
				}
			}); 
		}

//点击删除图标提示是否删除
function del(orderid){
	num=orderid;
	/* alert(num); */
	/* var order = document.getElementById(num); 
	order.style.display = "none"; */
	var flag=confirm("亲，您真的要取消订单吗？");
	if(flag){ //点击确定删除宝贝
	
		deleteorder();
	}
};
/* $(".orderthree").click(function(){
	var order = $(this); 
	var flag=confirm("亲，您真的要取消订单吗？");
	if(flag){ //点击确定删除宝贝
		deleteorder(order);
	}
	}); */
    </script>
</head>
<!--loading页开始-->
<div class="loading">
	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
<body>
	<header class="top-header fixed-header">
		<a class="icona" href="javascript:history.go(-1)">
				<img src="<%=path %>/statics/images/left.png"/>
			</a>
		<h3>待付款</h3>
			<a class="iconb" href="shopcar.html">
			</a>
	</header>
	
	<div class="contaniner fixed-conta">
		<c:forEach items="${list }" var="OrderThree">
			<c:if test="${OrderThree.getFahuoid()==2&&OrderThree.getZhifu()==2 }">
		<section id="${OrderThree.getId()}" class="order">
			<dl id="${OrderThree.getId()}">
				<dt>
					<time>${OrderThree.getOrder().getCreateTime() }</time>
					<span>待付款</span>
				</dt>
				<ul>
					<a href="<%=path %>/product/detail/${OrderThree.getProductId()}">
						<figure><img src="<%=path %>/statics/files/${OrderThree.getProducts().getFileName()}"/></figure>
						<li>
							<p>${OrderThree.getProducts().getDescription()}</p>
							<c:if test="${!empty OrderThree.getColor() }">
								<small>颜色：${OrderThree.getColor() }</small>
							</c:if>
							 <c:if test="${!empty OrderThree.getSize() }">
							 	<span>尺寸：${OrderThree.getSize() }</span>
							 </c:if>
							<b>${OrderThree.getProducts().getPrice() }</b>
							<strong>数量：${OrderThree.getQuantity() }</strong>
						</li>
					</a>
				</ul>
				<dd>
					<h3>商品总额</h3>
					<i>${OrderThree.getCost() }</i>
				</dd>
				<dd>
					<input type="button" onclick="location.href='<%=path%>/product/sys/buyid.html?oid=${OrderThree.id }'" value="去付款" class="order-que"/>
					<a href="go-order.html">
						<input type="button" value="订单详情" />
					</a>
					<input  class="orderthree" Orderthreeid="${OrderThree.getId()}"  type="button" value="取消订单" onclick="del(${OrderThree.getId()})" />
				</dd>
			</dl>
		</section>
		</c:if>
		</c:forEach>
	</div>
	
	
	
	

</body>
</html>